package com.azure.mapper.report;

import com.azure.entity.ATurnoverDailyReport;
import com.azure.entity.ATurnoverDailyReportExample;
import java.util.List;

import net.minidev.json.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface ATurnoverDailyReportMapper {
    int countByExample(ATurnoverDailyReportExample example);

    int deleteByExample(ATurnoverDailyReportExample example);

    int deleteByPrimaryKey(Long id);

    int insert(ATurnoverDailyReport record);

    int insertSelective(ATurnoverDailyReport record);

    List<ATurnoverDailyReport> selectByExample(ATurnoverDailyReportExample example);

    ATurnoverDailyReport selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") ATurnoverDailyReport record, @Param("example") ATurnoverDailyReportExample example);

    int updateByExample(@Param("record") ATurnoverDailyReport record, @Param("example") ATurnoverDailyReportExample example);

    int updateByPrimaryKeySelective(ATurnoverDailyReport record);

    int updateByPrimaryKey(ATurnoverDailyReport record);

    @Select("select * from a_turnover_daily_report where date = #{date} order by turnover desc")
    List<ATurnoverDailyReport> getDailyTurnoverData(@Param("date")String date);
    @Select("select date,sum(turnover) turnover from a_turnover_daily_report where date >= #{date}  group by date order by date")
    List<JSONObject> getTurnoverLine(@Param("date")String date);
}